import Vue from 'vue'
import Router from 'vue-router'

import UserList from '../components/UserList'
import Home from '../components/Home'
import App from '../App'

import PageOne from '../views/PageOne'
import PageTwo from '../views/PageTwo'
import PageThree from '../views/PageThree'
import PageFour from '../views/PageFour'
import Index from '../views/Index'
import BookUpdate from '../views/BookUpdate'

Vue.use(Router)

const routes=[

  {
    path:'/',
    name:'图书管理',
    show:true,
    redirect:"page1",
    component:Index,
    children:[
      {
        path:'/page1',
        name:'查询图书',
        component:PageOne
      },
      {
        path:'/page2',
        name:'添加图书',
        component:PageTwo
      }

    ]
  },
  {
    path:'/bookupdate',
    name:'修改书籍',
    show:false,
    component:BookUpdate
  },

  {
    path:'/navigation',
    name:'导航2',
    show:true,
    component:Index,
    children: [
      {
        path:'/page3',
        name:'页面3',
        component:PageThree
      },
      {
        path:'/page4',
        name:'页面4',
        component:PageFour
      }
    ]
  }

]

const router = new Router({
  mode:'history',
  base: process.env.DATABASE_ERR,
  routes

})
export default router
